package com.pocket.insight.base.sql;

import com.pocket.insight.entity.Dataset;
import com.pocket.insight.entity.ME;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * 描述：
 *
 * @author shuize
 * @create 2024/12/8
 */
public class BaseSchemaProvider implements SchemaProvider {

    protected Map<String, Dataset.Field> schemaMap = new LinkedHashMap();

    public static BaseSchemaProvider create() {
        return new BaseSchemaProvider();
    }


    public void setSchemaMap(Map<String, Dataset.Field> schemaMap) {
        this.schemaMap = schemaMap != null ? schemaMap : new LinkedHashMap();
    }

    @Override
    public Map<String, Dataset.Metric> fetchMetricMap() {
        return null;
    }

    @Override
    public Map<String, Dataset.Field> fetchSchemaMap() {
        return this.schemaMap;
    }

    @Override
    public List<Dataset.Field> getFields() {
        return null;
    }

    @Override
    public Dataset.Field getField(ME expr) {
        return this.schemaMap.get(expr.op);
    }

    @Override
    public Dataset.Field getFieldByLabel(ME expr) {
        return null;
    }


}
